/**
 * Licensee: DuKe TeAm
 * License Type: Purchased
 */
package ormsamples;

import org.orm.*;
public class CreateAuthData {
	public void createTestData() throws PersistentException {
		PersistentTransaction t = auth.AuthPersistentManager.instance().getSession().beginTransaction();
		try {
			auth.DAOFactory lDAOFactory = auth.DAOFactory.getDAOFactory();
			auth.dao.UsuarioDAO lauthUsuarioDAO = lDAOFactory.getUsuarioDAO();
			auth.Usuario lauthUsuario = lauthUsuarioDAO.createUsuario();
			// TODO Initialize the properties of the persistent object here, the following properties must be initialized before saving : pass, rut
			lauthUsuarioDAO.save(lauthUsuario);
			t.commit();
		}
		catch (Exception e) {
			t.rollback();
		}
		
	}
	
	public static void main(String[] args) {
		try {
			CreateAuthData createAuthData = new CreateAuthData();
			try {
				createAuthData.createTestData();
			}
			finally {
				auth.AuthPersistentManager.instance().disposePersistentManager();
			}
		}
		catch (Exception e) {
			e.printStackTrace();
		}
	}
}
